//
//  ContentInfo.m
//  TodayComment
//
//  Created by 张吉阳 on 15/9/12.
//  Copyright (c) 2015年 xianrenmoshi. All rights reserved.
//

#import "ContentInfo.h"
#import "ContentImageInfo.h"

@implementation ContentInfo

+ (instancetype)infoFromDict:(NSDictionary *)dict
{
    ContentInfo *info = [[ContentInfo alloc] init];
    
    info.title = [dict objectForKey:@"title"];
    info.ptime = [dict objectForKey:@"ptime"];
    info.body = [dict objectForKey:@"body"];
    info.replyBoard = [dict objectForKey:@"replyBoard"];
    
    NSArray *images =[dict objectForKey:@"img"];
    info.images = [ContentImageInfo arrayFromArray:images];
    
    
    info.source = [dict objectForKey:@"source"];
    info.digest = [dict objectForKey:@"digest"];
    info.ec = [dict objectForKey:@"ec"];
    info.sourceurl = [dict objectForKey:@"source_url"];
    info.json = [FxJsonUtility jsonValueFromObject:dict];
    return info;
}

@end
